package com.rjwh.dingdong.client.mvp.model.impl;

import com.aishua.lib.task.AsResult;
import com.rjwh.dingdong.client.constant.NetConstant;
import com.rjwh.dingdong.client.mvp.BaseModel;
import com.rjwh.dingdong.client.mvp.BasePresenter;
import com.rjwh.dingdong.client.mvp.model.IMathGameMyTracksModel;
import com.rjwh.dingdong.client.network.HttpWebService;
import com.rjwh.dingdong.client.network.HttpWebServiceCallBack;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Kay
 * @ClassName MathGameMyTracksModel
 * @Description
 * @date 2016-9-5
 * @history 2016-9-5 author: description:
 */
public class MathGameMyTracksModel extends BaseModel implements IMathGameMyTracksModel, HttpWebServiceCallBack {

    public MathGameMyTracksModel(BasePresenter basePresenter) {
        super(basePresenter);
    }

    /**
     * 取游戏记录
     *
     * @param bookid 游戏id
     */
    @Override
    public void doGeLastMathGameFootStep(String bookid,String packageversion) {
        Map<String, String> getBookIslandGameParams = new HashMap<>();
        getBookIslandGameParams.put("bookid", String.valueOf(bookid));
        getBookIslandGameParams.put("packageverson", String.valueOf(packageversion));
        HttpWebService.getDataFromServer(NetConstant.GETLASTMATHGAMEFOOTSTEPBYVERSION, getBookIslandGameParams, true, this);
    }

    @Override
    public void onServerDataAcquired(int businessType, AsResult mAsResult, boolean isRefresh) {
        if (getBasePresenter() != null) {
            getBasePresenter().onServerDataAcquired(businessType, mAsResult, isRefresh);
        }
    }
}
